#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<string> numtostr = { "","", "abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
    void SubFunction(string& digits, int di, string cdstr, vector<string>& v)
    {
        if (di == digits.size())
        {
            v.push_back(cdstr);
            return;
        }

        int num = digits[di] - '0';
        string str = numtostr[num];
        for (size_t i = 0; i < str.size(); i++)
        {
            SubFunction(digits, di + 1, cdstr + str[i], v);
        }
    }

    vector<string> letterCombinations(string digits)
    {
        vector<string> v;
        if (digits.size() == 0)
        {
            return v;
        }
        SubFunction(digits, 0, "", v);
        return v;
    }
};